/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 *//*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.worldjb.vk;

import javafx.application.Application;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import ru.worldjb.vk.auth.AuthScene;
import ru.worldjb.vk.util.MainProps;

/**
 * Главный класс программы
 * @author alex_xpert
 */
public class Main extends Application {
    
    @Override
    public void start(final Stage primaryStage) {
        // Загружаем настройки
        MainProps.load();
        // Если токена нет - показываем сцену авторизации
        if(MainProps.getProperty("access_token").equals("")) {
            primaryStage.getIcons().add(new Image("file:///F:/Mezhdunarodny_logotip_VK.png"));
            primaryStage.setScene(new AuthScene(primaryStage));
            primaryStage.show();
        // иначе - переходим к форме с данными профиля
        } else {
            ProfileFrame pf = new ProfileFrame();
            pf.setVisible(true);
        }
    }

    /**
     * The main() method is ignored in correctly deployed JavaFX application.
     * main() serves only as fallback in case the application can not be
     * launched through deployment artifacts, e.g., in IDEs with limited FX
     * support. NetBeans ignores main().
     *
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }
    
}
